home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 / Ham Radio 2000.iso / ham2000 / misc / tasm / misc.zoo / sc11test.asm < prev    next >
Assembly Source File  |  1991-07-13  |  2KB  |  168 lines

  1. */* Just a simple test program for the Small C compiler */
  2.  
  3. *******************************************************************
  4. * SMALL-C Compiler V2.0.2                               Feb 15 1987
  5. * Copyright 1982 J. E. Hendrix                                     
  6. * Modified by Motorola for 68HC11                                  
  7. * Modified by HCS to compile Compiler with Turbo-C 1.5             
  8. * Compiler compiled on: Jul 04 1988, 12:30:19
  9. *
  10. * 68HC11 Cross-Compile done on: 07/13/1991  16:41:54
  11. *
  12. *******************************************************************
  13. *
  14. *
  15. *main()
  16. cc1 equ *
  17. main equ *
  18. *{
  19. *        int i,j;
  20. *
  21. *        for(i = 0; i < 10; i++){
  22.  pshx
  23.  pshx
  24.  ldd #2
  25.  tsx
  26.  pshx
  27.  tsx
  28.  addd 0,x
  29.  pulx
  30.  pshb
  31.  psha
  32.  ldd #0
  33.  pulx
  34.  std 0,x
  35. cc5 equ *
  36.  ldd #2
  37.  tsx
  38.  pshx
  39.  tsx
  40.  addd 0,x
  41.  pulx
  42.  xgdx
  43.  ldd 0,x
  44.  pshb
  45.  psha
  46.  ldd #10
  47.  pulx
  48.  jsr cclt
  49.  cmpd #0
  50.  bne *+5
  51.  jmp cc4
  52.  jmp cc6
  53. cc3 equ *
  54.  ldd #2
  55.  tsx
  56.  pshx
  57.  tsx
  58.  addd 0,x
  59.  pulx
  60.  pshb
  61.  psha
  62.  pulx
  63.  xgdx
  64.  ldd 0,x
  65.  addd #1
  66.  std 0,x
  67.  subd #1
  68.  jmp cc5
  69. cc6 equ *
  70. *
  71. *                j = i * i;
  72.  ldd #0
  73.  tsx
  74.  pshx
  75.  tsx
  76.  addd 0,x
  77.  pulx
  78.  pshb
  79.  psha
  80.  ldd #4
  81.  tsx
  82.  pshx
  83.  tsx
  84.  addd 0,x
  85.  pulx
  86.  xgdx
  87.  ldd 0,x
  88.  pshb
  89.  psha
  90.  ldd #6
  91.  tsx
  92.  pshx
  93.  tsx
  94.  addd 0,x
  95.  pulx
  96.  xgdx
  97.  ldd 0,x
  98.  pulx
  99.  jsr ccmult
  100.  pulx
  101.  std 0,x
  102. *                outp(j);
  103.  ldd #0
  104.  tsx
  105.  pshx
  106.  tsx
  107.  addd 0,x
  108.  pulx
  109.  xgdx
  110.  ldd 0,x
  111.  pshb
  112.  psha
  113.  jsr outp
  114.  pulx
  115. *        }
  116.  jmp cc3
  117. cc4 equ *
  118. *}
  119.  pulx
  120.  pulx
  121.  rts
  122. *
  123. *outp(i)
  124. outp equ *
  125. *int     i;
  126. *{
  127. *        char * portaddr;
  128. *
  129. *        portaddr = 1024;    /* memory mapped port */
  130.  pshx
  131.  ldd #0
  132.  tsx
  133.  pshx
  134.  tsx
  135.  addd 0,x
  136.  pulx
  137.  pshb
  138.  psha
  139.  ldd #1024
  140.  pulx
  141.  std 0,x
  142. *
  143. *        *(portaddr) =  i;
  144.  ldd #0
  145.  tsx
  146.  pshx
  147.  tsx
  148.  addd 0,x
  149.  pulx
  150.  xgdx
  151.  ldd 0,x
  152.  pshb
  153.  psha
  154.  ldd #6
  155.  tsx
  156.  pshx
  157.  tsx
  158.  addd 0,x
  159.  pulx
  160.  xgdx
  161.  ldd 0,x
  162.  pulx
  163.  stab 0,x
  164. *}
  165.  pulx
  166.  rts
  167. *
  168.